import Vue from 'vue'
import Vuex from 'vuex'
import getters from './getters'
import app from './modules/app'
import settings from './modules/settings'
import user from './modules/user'

Vue.use(Vuex)

// const getters = {
//   // doubleCount(state) {
//   //   // 这里state是大仓库的state
//   //   return state.count * 2
//   // }

//   doubleCount: state => state.count * 2
// }

const store = new Vuex.Store({
  modules: {
    app,
    settings,
    user // 自己重写
  },

  // 想要快捷获取小仓库内的数据
  getters
})

export default store
